from PyQt5.QtWidgets import QApplication, QWidget, QTabWidget, QVBoxLayout
from sub_pages import SubPage1, SubPage2


class MainWindow(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle('抓取工具')
        self.setGeometry(800, 800, 800, 800)

        self.tabWidget = QTabWidget()

        # 创建子页面实例并添加到 Tab 中
        sub_page1 = SubPage1()
        sub_page2 = SubPage2()

        self.tabWidget.addTab(sub_page1, '设置参数')
        self.tabWidget.addTab(sub_page2, '子页面 2')

        main_layout = QVBoxLayout()
        main_layout.addWidget(self.tabWidget)
        self.setLayout(main_layout)


if __name__ == '__main__':
    app = QApplication([])
    window = MainWindow()
    window.show()
    app.exec_()
